package com.kingyun.gpsinspection.purificationservice.facade.service.activiti.dailythings;

import com.kingyun.gpsinspection.purificationservice.facade.model.jsm.EmployeeVo;
import com.kingyun.gpsinspection.purificationservice.facade.model.jsm.RedisValue;
import com.kingyun.gpsinspection.purificationservice.facade.model.tdm.DailyThingsVo;
import com.kingyun.gpsinspection.purificationservice.facade.model.tdm.TaskLink;
import com.kingyun.gpsinspection.purificationservice.facade.model.tdm.WorkOrderVo;

import java.util.List;

/**
 * 日常事务Service
 */
public interface DailyThingsService {

    /**
     * 保存信息
     *
     * @param redisValue
     * @param employeeVo
     * @param dailyThingsVo
     * @param uploadFiles
     * @param deletedFiles
     * @param workOrderList
     * @param processDefinitionId
     * @return
     */
    int save(RedisValue redisValue, EmployeeVo employeeVo, DailyThingsVo dailyThingsVo, String uploadFiles, String deletedFiles, List<WorkOrderVo> workOrderList,String processDefinitionId);

    /**
     * 根据流程实例ID查找对象
     *
     * @param piPiid
     * @return
     */
    DailyThingsVo findVoByPiPiid(String piPiid);

    /**
     * 现场操作
     *
     * @param redisValue
     * @param employeeVo
     * @param dailyThingsVo
     * @param taskLink
     * @return
     */
    int saveBySpotOperation(RedisValue redisValue, EmployeeVo employeeVo, DailyThingsVo dailyThingsVo, TaskLink taskLink);

    /**
     * 保存分析处理的关联的维护保养任务
     *
     * @param employeeVo
     * @param dailyThingsVo
     * @param uploadFiles
     * @param deletedFiles
     * @param workOrderList
     * @param analysisProcessId
     * @return
     */
    int saveRelation(EmployeeVo employeeVo, DailyThingsVo dailyThingsVo, String uploadFiles, String deletedFiles, List<WorkOrderVo> workOrderList, String analysisProcessId);

    /**
     * 修改分析处理关联的维护保养任务页面：不走BPM
     *
     * @param employeeVo
     * @param dailyThingsVo
     * @param uploadFiles
     * @param deletedFiles
     * @param workOrderVoList
     * @return
     */
    int updateRelation(EmployeeVo employeeVo, DailyThingsVo dailyThingsVo, String uploadFiles, String deletedFiles, List<WorkOrderVo> workOrderVoList);

    /**
     * 根据主键查询bean
     *
     * @param dailythingsId
     * @return
     */
    DailyThingsVo queryBeanById(String dailythingsId);

    /**
     * 发起BPM流程：和save方法相似
     *
     * @param redisValue
     * @param employeeVo
     * @param dailyThingsVo
     * @param workOrderVoList
     */
    int launchBPM(RedisValue redisValue, EmployeeVo employeeVo, DailyThingsVo dailyThingsVo, List<WorkOrderVo> workOrderVoList);

    /**
     * 查询任务信息（包含关联信息）
     */
    DailyThingsVo queryVoById(String taskId);
}
